package org.kazuhiko.pokemon3d.entity;

import java.util.ArrayList;

import org.kazuhiko.pokemon3d.physics.Collision;
import org.lwjgl.util.vector.Vector3f;

public abstract class Drawable extends Entity
{
	private Vector3f position;
	private Vector3f rotation;
	private Vector3f defaultRotation;
	
	private float width;
	private float height;
	private float depth;
	
	private ArrayList<Collision> collisions;
	
	public Drawable( int id, String name )
	{
		super( id, name );
		
		position = new Vector3f( 0, 0, 0 );
		rotation = new Vector3f( 0, 0, 0 );
		defaultRotation= new Vector3f( 0, 180f, 0 );
		
		collisions = new ArrayList<Collision>();
		
		width = 0;
		height = 0;
		depth = 0;
	}
	
	public ArrayList<Collision> getCollisions()
	{
		return collisions;
	}
	
	public float getYTop()
	{
		return getPosition().y + height;
	}
	
	public void setWidth( float width )
	{
		this.width = width;
	}
	
	public float getWidth()
	{
		return width;
	}
	
	public void setHeight( float height )
	{
		this.height = height;
	}
	
	public float getHeight()
	{
		return height;
	}
	
	public void setDepth( float depth )
	{
		this.depth = depth;
	}
	
	public float getDepth()
	{
		return depth;
	}
	
	public Vector3f getDefaultRotation()
	{
		return defaultRotation;
	}
	
	public float getDefaultPitch()
	{
		return defaultRotation.x;
	}
	
	public float getDefaultYaw()
	{
		return defaultRotation.y;
	}
	
	public float getDefaultRoll()
	{
		return defaultRotation.z;
	}
	
	public void setDefaultRotation( Vector3f defaultRotation )
	{
		this.defaultRotation = defaultRotation;
	}
	
	public void setDefaultRotation( float pitch, float yaw, float roll )
	{
		this.defaultRotation = new  Vector3f( pitch, yaw, roll );
	}
	
	public void setDefaultPitch( float pitch )
	{
		this.defaultRotation.x = pitch;
	}
	
	public void setDefaultYaw( float yaw )
	{
		this.defaultRotation.y = yaw;
	}
	
	public void setDefaultRoll( float roll )
	{
		this.defaultRotation.z = roll;
	}
	
	public Vector3f getPosition()
	{
		return position;
	}
	
	public void setPosition( Vector3f position )
	{
		this.position = position;
	}
	
	public void setPosition( float x, float y, float z)
	{
		this.position = new Vector3f( x, y, z );
	}
	
	public float x()
	{
		return position.x;
	}
	
	public void setX( float x )
	{
		this.position.x = x;
	}
	
	public float y()
	{
		return position.y;
	}
	
	public void setY( float y )
	{
		this.position.y = y;
	}
	
	public float z()
	{
		return position.z;
	}
	
	public void setZ( float z )
	{
		this.position.z = z;
	}
	
	public Vector3f getRotation()
	{
		return rotation;
	}
	
	public void setRotation( Vector3f rotation )
	{
		this.rotation = rotation;
	}
	
	public void setRotation( float pitch, float yaw, float roll )
	{
		this.rotation = new Vector3f( pitch, yaw, roll );
	}
	
	public float pitch()
	{
		return rotation.x;
	}
	
	public void setPitch( float pitch )
	{
		this.rotation.x = pitch;
	}
	
	public float yaw()
	{
		return rotation.y;
	}
	
	public void setYaw( float yaw )
	{
		this.rotation.y = yaw;
	}
	
	public float roll()
	{
		return rotation.z;
	}
	
	public void setRoll( float roll )
	{
		this.rotation.z = roll;
	}
	
	public abstract void tick();
	
	public abstract void update();
	
	public abstract void render();
}
